package com.zzzzzz.account.model;

import org.neo4j.graphdb.Direction;
import org.neo4j.graphdb.traversal.Evaluators;
import org.neo4j.graphdb.traversal.TraversalDescription;
import org.neo4j.kernel.impl.traversal.TraversalDescriptionImpl;
import org.springframework.data.neo4j.core.FieldTraversalDescriptionBuilder;
import org.springframework.data.neo4j.mapping.Neo4jPersistentProperty;

import com.zzzzzz.common.util.Rels;

public class FollowersTraversalBuilder implements FieldTraversalDescriptionBuilder {
	
    public TraversalDescription build(Object start, Neo4jPersistentProperty field, String... params) {
        return new TraversalDescriptionImpl()
                .breadthFirst()
                .relationships(Rels.FOLLOW, Direction.INCOMING)
                .evaluator(Evaluators.atDepth(1));
    }

}
